/*
 * BombermanView.h
 *
 *  Created on: 24/05/2014
 *      Author: javier
 */

#ifndef BOMBERMANVIEW_H_
#define BOMBERMANVIEW_H_

#include <SDL2/SDL.h> // SDL_Rect
#include "Drawable.h"
#include "Positionable.h"
#include "Utils.h"
#include "ViewCoordinatesConverter.h"

#define SPRITES_TAM 20 // 5 sprites X 4 direcciones

// tipos de colores de los bomberman, usados en el construcor
enum BombermanColor{
	WHITE, BLACK, RED, PURPLE, GREEN, YELLOW
};

/*
 * Clase que maneja las texturas y secciones de texturas de la vista animada de un bomberman
 */
class BombermanView: public Drawable {
public:
	BombermanView(SDLWindow* window, SDL_Texture* texture, Positionable* object, BombermanColor color);
	void render(Camera& cam);
	void update();
	virtual ~BombermanView();
private:
	SDL_Rect clips[SPRITES_TAM];
	int useClip;
	SDLWindow* window;
	SDL_Texture* texture;
	int base;
	Positionable* object;
	Cycler cycler;
	std::pair<double, double> position, previousPosition;
};

#endif /* BOMBERMANVIEW_H_ */
